﻿using System;
using System.Data;
using System.Collections;
using System.Collections.Generic;
using OgilvyOne.Model;
using OgilvyOne.DALFactory;
using OgilvyOne.IDAL;

namespace OgilvyOne.BLL
{
    public class DictionaryManageBLL
    {
        public DataSet GetDictionary(string strWhere)
        {

            return DictionaryManageFactory.create().GetDictionary(strWhere);
            
        }

        private DictionaryManageIDAL Dictionary = DictionaryManageFactory.create();

        public int updateDictionary(DictionaryManageModel updDic)
        {
            return DictionaryManageFactory.create().updateDictionary(updDic);
        }
        public DictionaryManageModel selectDictionary(int cid)
        {
            return DictionaryManageFactory.create().selectDictionary(cid);
        }
        public int AddDictionary(DictionaryManageModel getDic)
        {
            return Dictionary.AddDictionary(getDic);
        }
        public bool deleteDictionary(int CID)
        {
            return Dictionary.deleteDictionary(CID);
        }
        public bool deleteDictionary(string CID)
        {
            return Dictionary.deleteDictionary(CID);
        }
        /// <summary>
        /// 获取子字典列表
        /// </summary>
        /// <param name="upid"></param>
        /// <returns></returns>
        public IList GetDictionary(int upid)
        {
            return Dictionary.GetDictionary(upid);
        }
        /// <summary>
        /// 查询是否有子栏目
        /// </summary>
        public int selectSon(int cid)
        {
            return DictionaryManageFactory.create().selectSon(cid);
        }
    }
}
